﻿// See https://aka.ms/new-console-template for more information
//Console.WriteLine("Hello, World!");

using StatePattern;

/*Console.WriteLine("************************第一个版本*********************");
TrafficLight trafficLight = new TrafficLight();
trafficLight.Show();
trafficLight.Turn();

trafficLight.Show();
trafficLight.Turn();

trafficLight.Show();
trafficLight.Turn();*/

/*Console.WriteLine("************************第二个版本*********************");
LightBase green = new LightGreen();
green.Show();
green.Turn();
green.Show();
green.Turn();
green.Show();
green.Turn();
green.Show();
green.Turn();

LightBase yellow = new LightYellow();
yellow.Show();
yellow.Turn();

LightBase red = new LightRed();
red.Show();
red.Turn();*/

Console.WriteLine("************************第三个版本*********************");
LightBase green =new LightGreen();
Context context = new Context();
context.CurrentLight = green;
context.Show();
context.Turn();
context.Show();
context.Turn();
context.Show();
context.Turn();
context.Show();
context.Turn();
context.Show();
context.Turn();


